{% extends 'cms/base.html' %}

{% block title %}
新增人员
{% endblock %}

{% block head %}

{% endblock %}

{% block content-header %}
<h1>新增人员</h1>
{% endblock %}

{% block content %}
<div class="row">
<div class="col-md-6">
    <div class="box">
        <form action="" method="post">
        {# 解决跨域问题 #}
        {% csrf_token %}
            <div class="box-body">
                {% if messages %}
                    <div class="input-group">
                        {# message消息是一个需要遍历才能提取的消息 #}
                        {% for message in messages %}
                            <p style=" color: red;text-align: center">{{ message }}</p>
                        {% endfor %}
                    </div>
                {% endif %}
                <div class="form-group">
                    <label for="telephone-input">用户名称：</label>
                    <input type="text" class="form-control" name="username" placeholder="用户名">
                </div>
                <div class="form-group">
                    <label for="telephone-input">手机号码：</label>
                    <input type="text" class="form-control" name="telephone" placeholder="手机号码">
                </div>
                <div class="form-group">
{#                <div class="checkbox">#}
                    {# 勾选方式1： #}
                    <label for="">工作岗位：</label>
                    <select name="category" id="category-select" class="form-control">
                        {% for group in groups %}
                            <option value="{{ group.pk }}">{{ group.name }}</option>
                        {% endfor %}
                    </select>
                    {# 勾选方式2： #}
{#                    {% for group in groups %}#}
{#                        <label for="">#}
{#                            <input type="select_box" name="groups" value="{{ group.pk }}">{{ group.name }}#}
{#                            <input type="checkbox" name="groups" value="{{ group.pk }}">{{ group.name }}#}
{#                        </label>#}
{#                    {% endfor %}#}
                </div>
            </div>
            <div class="box-footer">
            <button class="btn btn-primary pull-right">提交</button>
        </div>
        </form>

    </div>
</div>
</div>
{% endblock %}